<header class="bar bar-header bar-stable">
    <h1 class="title">新建会话</h1>
</header>
<ion-content class="has-header" ng-controller="SessionConfigEditController">
    <form name="editSessionConfigForm" novalidate="novalidate">
        <div class="list">
            <label class="item item-input">
                <i class="icon ion-person-add placeholder-icon"></i>
                <input type="text" placeholder="{{sshSessionConfig.name}}" name="name" ng-model="sshSessionConfig.name" required>
                <i ng-show="editSessionConfigForm.name.$invalid && editSessionConfigForm.name.$dirty" class="icon ion-close-circled placeholder-icon assertive shc-valid" title="请输入会话名"></i>
                <i ng-show="editSessionConfigForm.name.$valid && editSessionConfigForm.name.$dirty" class="icon ion-checkmark-circled placeholder-icon balanced shc-valid" title="请输入会话名"></i>
            </label>
            <label class="item item-input">
                <i class="icon ion-ios-home placeholder-icon"></i>
                <input type="text" placeholder="主机名" ng-model="sshSessionConfig.host" name="host" ng-pattern="/{(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(.+\.(.+))/" required>
                <i ng-show="editSessionConfigForm.host.$invalid && editSessionConfigForm.host.$dirty" class="icon ion-close-circled placeholder-icon assertive shc-valid" title="主机名输入有误"></i>
                <i ng-show="editSessionConfigForm.host.$valid && editSessionConfigForm.host.$dirty" class="icon ion-checkmark-circled placeholder-icon balanced shc-valid" title="主机名输入有误"></i>
            </label>
            <label class="item item-input">
                <i class="icon ion-person placeholder-icon"></i>
                <input type="text" placeholder="用户名" ng-model="sshSessionConfig.user" name="user" required>
                <i ng-show="editSessionConfigForm.user.$invalid && editSessionConfigForm.user.$dirty" class="icon ion-close-circled placeholder-icon assertive shc-valid" title="请输入用户名"></i>
                <i ng-show="editSessionConfigForm.user.$valid && editSessionConfigForm.user.$dirty" class="icon ion-checkmark-circled placeholder-icon balanced shc-valid" title="请输入用户名"></i>
            </label>
            <label class="item item-input">
                <i class="icon ion-locked placeholder-icon"></i>
                <input type="password" placeholder="密码" ng-model="sshSessionConfig.password" name="password" required>
                <i ng-show="editSessionConfigForm.password.$invalid && editSessionConfigForm.password.$dirty" class="icon ion-close-circled placeholder-icon assertive shc-valid" title="请输入密码"></i>
                <i ng-show="editSessionConfigForm.password.$valid && editSessionConfigForm.password.$dirty" class="icon ion-checkmark-circled placeholder-icon balanced shc-valid" title="请输入密码"></i>
            </label>
            <label class="item item-checkbox">
                <label class="checkbox">
                    <input type="checkbox" value="true" ng-model="sshSessionConfig.showAdvance" class="small">
                </label>
                <h4 class="small">显示高级选项</h4>
            </label>
            <label class="item item-input" ng-show="sshSessionConfig.showAdvance">
                <label class="input-label" >端口</label>
                <input type="number" ng-model="sshSessionConfig.port" name="port" required>
                <i ng-show="editSessionConfigForm.port.$invalid && editSessionConfigForm.port.$dirty" class="icon ion-close-circled placeholder-icon assertive shc-valid" title="请输入用户名"></i>
                <i ng-show="editSessionConfigForm.port.$valid && editSessionConfigForm.port.$dirty" class="icon ion-checkmark-circled placeholder-icon balanced shc-valid" title="请输入用户名"></i>
            </label>
            <label class="item item-input">
                <label class="input-label">保存密码</label>
                <label class="toggle toggle-balanced">
                    <input type="checkbox" value="true" ng-model="savePassword">
                    <div class="track">
                        <div class="handle"></div>
                    </div>
                </label>
            </label>
            <label class="item item-input">
                <button class="button button-balanced" ng-click="saveSSHSessionConfig()">连接</button>
            </label>
        </div>
    </form>
</ion-content>